package com;

public class Student {
    //1、把Student 的属性都作为私有，并提供getter/setter 方法以及适当的构造方法。
    //2、为Student 类添加一个getPostAddress 方法，要求返回Student 对象的地址和邮编
    private String name;//姓名
    private int age;//年龄
    private String address;//地址
    private String zipCode;//邮政编码
    private String mobile;//手机号

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public Student(){
        this.name="宋健";
        this.age=24;
        this.address="城西小区";
        this.zipCode="231500";
        this.mobile="18456540066";
    }
    public Student(String name,int age,String address,String zipCode,String mobile){
        this.name=name;
        this.age=age;
        this.address=address;
        this.zipCode=zipCode;
        this.mobile=mobile;
    }
    public void getPostAddress(){
        System.out.println("自我介绍一下\r\n姓名："+this.name+"年龄："+this.age+"地址："+this.address+"邮政编码："+this.zipCode+"手机号："+this.mobile);
    }
}
